package com.lovegu.object.middle;

/**
 * @author 老顾
 * @title: ConversionTest
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/9/21 9:06
 */
public class ConversionTest {
    public static void main(String[] args) {
        double d = 13.4;
        long l = (long) d;
        System.out.println(l);
        int in = 5;
        // boolean b = (boolean)in;
        Object obj = "Hello";
        String objStr = (String) obj;
        System.out.println(objStr);
        Object objPri = new Integer(5);
        // 所以下面代码运行时引发ClassCastException异常
        String str = (String) objPri;
    }
}
